<?php
/**
 * @copyright  For copyright and license information, read the COPYING.txt file.
 * @link       /COPYING.txt
 * @license    Academic Free License (AFL 3.0)
 * @package     default_default
 */

/** @var Mage_Adminhtml_Block_Widget_Form_Renderer_Fieldset $this */
/** @var Varien_Data_Form_Element_Fieldset $_element */
?>
<?php $_element = $this->getElement() ?>
<div class="rule-tree">
    <div class="entry-edit-head">
        <h4 class="icon-head head-edit-form fieldset-legend"><?php echo $_element->getLegend() ?></h4>
    </div>
    <fieldset id="<?php echo $_element->getHtmlId() ?>" <?php echo $_element->serialize(['class']) ?>>
    <?php if ($_element->getComment()): ?>
        <p class="comment"><?php echo $this->escapeHtml($_element->getComment()) ?></p>
    <?php endif ?>
    <?php echo $_element->getChildrenHtml() ?>
    </fieldset>
</div>
<script type="text/javascript">
var <?php echo $_element->getHtmlId() ?> = new VarienRulesForm('<?php echo $_element->getHtmlId() ?>', '<?php echo $this->getNewChildUrl() ?>');
<?php if ($_element->getReadonly()): ?>
    <?php echo $_element->getHtmlId() ?>.setReadonly(true);
<?php endif ?>
</script>
